package com.maxd.modules.redPacket.controller;

import com.maxd.error.Result;
import com.maxd.modules.redPacket.entity.Storeroom;
import com.maxd.modules.redPacket.service.IStoreroomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author fang
 * @date 2021/1/15
 */
@RestController
@Api(value = "文案或链接", tags = {"文案或链接"})
@RequestMapping(value = "/storeroom")
public class StoreroomController {

    @Autowired
    private IStoreroomService storeroomService;

    @PostMapping("/insertStoreroom")
    @ApiOperation("添加或修改文案或链接")
    public Result insertStoreroom(@RequestBody Storeroom storeroom){
        return storeroomService.insertStoreroom(storeroom);
    }

    @GetMapping("/selectStoreroomListByClassify")
    @ApiOperation("根据分类名称模糊查询文案或链接")
    public Result selectStoreroomListByClassify(Integer page,Integer size,Integer classify,String content){
        return storeroomService.selectStoreroomPageByClassify(page, size, classify, content);
    }

    @GetMapping("/deleteStoreroomById")
    @ApiOperation("删除文案或链接")
    public Result deleteStoreroomById(Long id){
        return storeroomService.deleteStoreroomById(id);
    }




}